<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="/static/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form">
  <div class="mainBox">
    <div class="main-container">
      <div class="layui-form-item">
        <label class="layui-form-label">文件/目录名</label>
        <div class="layui-input-block">
          <div class="layui-form-mid">{$info.source_name}</div>
        </div>
      </div>

      <div class="layui-form-item">
        <label class="layui-form-label">储存类型</label>
        <div class="layui-input-block">
          <div class="layui-form-mid">{$info.source_type?'文件':'目录'}</div>
        </div>
      </div>

      <div class="layui-form-item">
        <label class="layui-form-label">所属用户</label>
        <div class="layui-input-block">
          <div class="layui-form-mid">{$info.source_username}</div>
        </div>
      </div>

      <div class="layui-form-item">
        <label class="layui-form-label">链接地址</label>
        <div class="layui-input-block">
          <div class="layui-form-mid"><a href="{$info.source_url}" target="_blank">{$info.source_url}</a></div>
        </div>
      </div>

      <br>

      <div class="layui-form-item">
        <label class="layui-form-label">举报类型</label>
        <div class="layui-input-block">
          <div class="layui-form-mid">{$info.type}</div>
        </div>
      </div>

      <div class="layui-form-item">
        <label class="layui-form-label">联系方式</label>
        <div class="layui-input-block">
          <div class="layui-form-mid">{$info.contact}</div>
        </div>
      </div>

      <div class="layui-form-item">
        <label class="layui-form-label">举报理由</label>
        <div class="layui-input-block">
          <div class="layui-form-mid">{$info.content}</div>
        </div>
      </div>


    </div>
  </div>
  <div class="bottom">
    <div class="button-container">
      <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
        <i class="layui-icon layui-icon-ok"></i>
        完成处理
      </button>
      <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
        <i class="layui-icon layui-icon-refresh"></i>
        取消处理
      </button>
    </div>
  </div>
</form>
<script src="/static/component/layui/layui.js"></script>
<script src="/static/component/pear/pear.js"></script>
<script>
  layui.use(['form','jquery'],function(){
    let form = layui.form;
    let $ = layui.jquery;
    form.on('submit(save)', function(data){
      $.ajax({
        data:JSON.stringify({status:1}),
        dataType:'json',
        contentType:'application/json',
        type:'post',
        success:function(res){
          //判断有没有权限
          if(res && res.code == 999){
            layer.msg(res.msg, {
              icon: 5,
              time: 2000,
            })
            return false;
          }else if(res.code == 200){
            layer.msg(res.msg,{icon:1,time:1000},function(){
              parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
              parent.layui.table.reload("user-table");
            });
          }else{
            layer.msg(res.msg,{icon:2,time:1000});
          }
        }
      })
      return false;
    });
  })
</script>
</body>
</html>